package code.google.gui.adapter.util;

import java.util.Locale;

import android.app.Activity;
import android.content.Context;
import android.content.res.Resources;
import android.support.v4.app.Fragment;
import code.google.gui.fragments.DummyFragment1;
import code.google.gui.fragments.DummyFragment2;
import code.google.gui.fragments.DummyFragment3;

import com.example.metamusicgui.R;

public class SettingsContext extends MenuContext {
	
	private Fragment settings1;
	private Fragment settings2;
	private Fragment settings3;
	private int itemIDSettings1;
	private int itemIDSettings2;
	private int itemIDSettings3;

	public SettingsContext(Context context) {
		super(context);
		
		settings1 = new DummyFragment1();
		settings2 = new DummyFragment2();
		settings3 = new DummyFragment3();
		
		itemIDSettings1 = getItemID();
		itemIDSettings2 = getItemID();
		itemIDSettings3 = getItemID();
		
		setDummyData(settings1, "SETTINGS1");
		setDummyData(settings2, "SETTINGS2");
		setDummyData(settings3, "SETIINGS3");
	}

	@Override
	public Fragment getItemHook(int position) {
		switch (position) {
		case 1:
			return settings1;
		case 2:
			return settings2;
		case 3:
			return settings3;
		default:
			return null;
		}
	}

	@Override
	public int getCountHook() {
		return 3;
	}

	@Override
	public CharSequence getPageTitleHook(int position) {
		Locale l = Locale.getDefault();
		Resources res = context.getResources();
		switch (position) {
		case 1:
			return res.getString(R.string.title_settings1).toUpperCase(l);
		case 2:
			return res.getString(R.string.title_settings2).toUpperCase(l);
		case 3:
			return res.getString(R.string.title_settings3).toUpperCase(l);
		}
		return null;
	}

	@Override
	public long getItemIDHook(int position) {
		switch (position) {
		case 1:
			return itemIDSettings1;
		case 2:
			return itemIDSettings2;
		case 3:
			return itemIDSettings3;
		}
		return -1;
	}

	@Override
	protected void onRegistrateFragmentsHook(Activity context) {
		// TODO Auto-generated method stub
		
	}

	@Override
	protected void onDeregistrateFragmentsHook(Activity context2) {
		// TODO Auto-generated method stub
		
	}

}
